home *** CD-ROM | disk | FTP | other *** search
/ PC Media 4 / PC MEDIA CD04.iso / share / prog / res104 / source / error.h next >
Encoding:
C/C++ Source or Header  |  1994-08-30  |  843 b   |  39 lines

  1. #if !defined (ERRORdotH)
  2. #define ERRORdotH
  3.  
  4.  
  5. //*****
  6. //***** Error reporting class.
  7. //*****
  8.  
  9. class ErrorReporter
  10. {
  11.   void (*reportFunc)(char *errorString);    // function used to report error
  12. public:
  13.   ErrorReporter();
  14.   void operator << (char *errorString);     // report an error
  15.   inline void reporter(void (*func)(char *str));
  16. };
  17.  
  18. extern ErrorReporter errorReporter;
  19.  
  20.  
  21.  
  22. /**************************************************************************
  23. *  Function:    ErrorReporter::reporter
  24. *
  25. *  Purpose:     Change the current reporting function.
  26. *
  27. *  Entry:       func = Pointer to the new reporting function.
  28. *
  29. *  Exit:        N/A
  30. **************************************************************************/
  31.  
  32. inline void ErrorReporter::reporter(void (*func)(char *str))
  33. {
  34.   reportFunc = func;
  35. }
  36.  
  37.  
  38. #endif
  39.